package com.ruoyi.erp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.LedyBacFeeConfigMapper;
import com.ruoyi.erp.domain.LedyBacFeeConfig;
import com.ruoyi.erp.service.ILedyBacFeeConfigService;

/**
 * 凭证生成规则Service业务层处理
 * 
 * @author ztj
 * @date 2023-05-09
 */
@Service
public class LedyBacFeeConfigServiceImpl implements ILedyBacFeeConfigService 
{
    @Autowired
    private LedyBacFeeConfigMapper ledyBacFeeConfigMapper;

    /**
     * 查询凭证生成规则
     * 
     * @param id 凭证生成规则主键
     * @return 凭证生成规则
     */
    @Override
    public LedyBacFeeConfig selectLedyBacFeeConfigById(Long id)
    {
        return ledyBacFeeConfigMapper.selectLedyBacFeeConfigById(id);
    }

    /**
     * 查询凭证生成规则列表
     * 
     * @param ledyBacFeeConfig 凭证生成规则
     * @return 凭证生成规则
     */
    @Override
    public List<LedyBacFeeConfig> selectLedyBacFeeConfigList(LedyBacFeeConfig ledyBacFeeConfig)
    {
        return ledyBacFeeConfigMapper.selectLedyBacFeeConfigList(ledyBacFeeConfig);
    }

    /**
     * 新增凭证生成规则
     * 
     * @param ledyBacFeeConfig 凭证生成规则
     * @return 结果
     */
    @Override
    public int insertLedyBacFeeConfig(LedyBacFeeConfig ledyBacFeeConfig)
    {
        ledyBacFeeConfig.setCreateTime(DateUtils.getNowDate());
        return ledyBacFeeConfigMapper.insertLedyBacFeeConfig(ledyBacFeeConfig);
    }

    /**
     * 修改凭证生成规则
     * 
     * @param ledyBacFeeConfig 凭证生成规则
     * @return 结果
     */
    @Override
    public int updateLedyBacFeeConfig(LedyBacFeeConfig ledyBacFeeConfig)
    {
        ledyBacFeeConfig.setUpdateTime(DateUtils.getNowDate());
        return ledyBacFeeConfigMapper.updateLedyBacFeeConfig(ledyBacFeeConfig);
    }

    /**
     * 批量删除凭证生成规则
     * 
     * @param ids 需要删除的凭证生成规则主键
     * @return 结果
     */
    @Override
    public int deleteLedyBacFeeConfigByIds(Long[] ids)
    {
        return ledyBacFeeConfigMapper.deleteLedyBacFeeConfigByIds(ids);
    }

    /**
     * 删除凭证生成规则信息
     * 
     * @param id 凭证生成规则主键
     * @return 结果
     */
    @Override
    public int deleteLedyBacFeeConfigById(Long id)
    {
        return ledyBacFeeConfigMapper.deleteLedyBacFeeConfigById(id);
    }
}
